package com.financing.wap.vo;

import org.codehaus.jackson.map.annotate.JsonSerialize;

import com.financing.wap.util.Constants;

/**
 * @author lisu
 * 
 * 产品VO
 * 查询条件转化
 * 转化order参数 order字段（将前端01，02类型转成数据库字段）
 *
 */
@JsonSerialize(include=JsonSerialize.Inclusion.NON_NULL)
public class ProductVO extends BaseVO{

	/**
	 * 
	 */
	private static final long serialVersionUID = 6576544825342384419L;

    private String type;//产品类型
    
    private String pPaymentInterestType;//付息方式
    
    private String pInvestType; //投资类型
    
    private String pPublicArea;//所在地区
    
    private String pLevel; //产品评级
    
    private String saleStatus; //产品销售状态;
    
    private String minimumAmount;//起购金额  pevc起购金额以 01，02，03表示区间
	private Integer minimumAmountStart; //转化数据库类型 -起购金额 
	private Integer minimumAmountEnd; //转化数据库类型 -起购金额 
    
    private String pShortName; //产品简称 
    
    private String pSizeRatioType;  //大小配比类型(01:小额畅打,02:已配出小额,03:严格配比,04:全大额)
    
    private String orderParameter; // order字段（将前端01，02类型转成数据库字段）
    
    private String orderType; // orderType（将前端01，02类型转成数据库 desc asc）
    
    private String dueTime; //前台录入类型  -产品期限
	private Integer dueTimeStart; //转化数据库类型 -产品期限
	private Integer dueTimeEnd; //转化数据库类型 -产品期限
	
	private String annualRevenue;//前台录入类型  -预期收益:
	private Integer annualRevenueStart;//转化数据库类型 -预期收益:
	private Integer annualRevenueEnd ;//转化数据库类型 -预期收益:
	
	private String rabateRatio;//前台录入类型  -返佣比例:
	private Integer rabateRatioStart;//转化数据库类型 -返佣比例:
	private Integer rabateRatioEnd ;//转化数据库类型 -返佣比例:
	
	private String pRabateProfitParameter;//返佣
	private String pAnnualRevenueExpectParameter;//年化率
	
	public String getpRabateProfitParameter() {
		return pRabateProfitParameter;
	}

	public void setpRabateProfitParameter(String pRabateProfitParameter) {
		this.pRabateProfitParameter = pRabateProfitParameter;
	}

	public String getpAnnualRevenueExpectParameter() {
		return pAnnualRevenueExpectParameter;
	}

	public void setpAnnualRevenueExpectParameter(
			String pAnnualRevenueExpectParameter) {
		this.pAnnualRevenueExpectParameter = pAnnualRevenueExpectParameter;
	}

	private String rabateAnnualFlag; // rabateRatioStart  annualRevenueStart  有个不为空的时候有值

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public String getpPaymentInterestType() {
		return pPaymentInterestType;
	}

	public void setpPaymentInterestType(String pPaymentInterestType) {
		this.pPaymentInterestType = pPaymentInterestType;
	}

	public String getpInvestType() {
		return pInvestType;
	}

	public void setpInvestType(String pInvestType) {
		this.pInvestType = pInvestType;
	}

	public String getpPublicArea() {
		return pPublicArea;
	}

	public void setpPublicArea(String pPublicArea) {
		this.pPublicArea = pPublicArea;
	}

	public String getpLevel() {
		return pLevel;
	}

	public void setpLevel(String pLevel) {
		this.pLevel = pLevel;
	}

	public String getMinimumAmount() {
		return minimumAmount;
	}

	public void setMinimumAmount(String minimumAmount) {
		if("01".equals(minimumAmount)){
			//100万以上	
			minimumAmountStart = 1000000;
		}else 
		if("02".equals(minimumAmount)){
			//300万以上
			minimumAmountStart = 3000000;
			
		}else 
		if("03".equals(minimumAmount)){
			//500万以上
			minimumAmountStart = 5000000;
		}else
		if("04".equals(minimumAmount)){
			//1000万以上
			minimumAmountStart = 10000000;
		}else
		if("05".equals(minimumAmount)){
			//不限 不添加信息
		}else{
			this.minimumAmount = minimumAmount;
		}
	}

	public String getpShortName() {
		return pShortName;
	}

	public void setpShortName(String pShortName) {
		this.pShortName = pShortName;
	}

	public String getpSizeRatioType() {
		return pSizeRatioType;
	}

	public void setpSizeRatioType(String pSizeRatioType) {
		this.pSizeRatioType = pSizeRatioType;
	}

	public String getOrderParameter() {
		return orderParameter;
	}

	public void setOrderParameter(String orderParameter) {
		//01 投资期限 02 付息方式
 		if("01".equals(orderParameter)){
 			this.orderParameter = "P_DUE_TIME";
 		}else if("02".equals(orderParameter)){
 			this.orderParameter = "P_PAYMENT_INTEREST_TYPE";
 		}
	}

	public String getOrderType() {
		
		
		return orderType;
	}

	public void setOrderType(String orderType) {
		//01 降序 02 升序
 		if("01".equals(orderType)){
 			this.orderType =  "desc";
 		}else if("02".equals(orderType)){
 			this.orderType = "asc";
 		}else{
 			this.orderType =  "desc";
 		}
	}

	public String getDueTime() {
		return dueTime;
	}

	public void setDueTime(String dueTime) {
		this.dueTime = dueTime;
		int yearDay = 12;
		if(Constants.P_DUETIME_TYPE_ONE_WITHIN.equals(dueTime)){
			//6个月内
			dueTimeStart = 0;
			dueTimeEnd = yearDay/2;
		}
		if(Constants.P_DUETIME_TYPE_ONE_TWO.equals(dueTime)){
			//6-12个月
			dueTimeStart = yearDay/2;
			dueTimeEnd = yearDay;
		}
		if(Constants.P_DUETIME_TYPE_TWO_THREE.equals(dueTime)){
			//1-2年
			dueTimeStart = yearDay*1;
			dueTimeEnd = yearDay*2;
		}
		if(Constants.P_DUETIME_TYPE_THREE_MORE.equals(dueTime)){
			//2年以上(含3年)
			dueTimeStart = yearDay*2;
		}if(Constants.P_DUETIME_TYPE_UNLIMITED.equals(dueTime)){
			//产品期限：不限  不添加信息
		}
	}

	public Integer getDueTimeStart() {
		
		return dueTimeStart;
	}

	public void setDueTimeStart(Integer dueTimeStart) {
		this.dueTimeStart = dueTimeStart;
	}

	public Integer getDueTimeEnd() {
		return dueTimeEnd;
	}

	public void setDueTimeEnd(Integer dueTimeEnd) {
		this.dueTimeEnd = dueTimeEnd;
	}

	public String getAnnualRevenue() {
		return annualRevenue;
	}

	public Integer getAnnualRevenueStart() {
		return annualRevenueStart;
	}

	public void setAnnualRevenueStart(Integer annualRevenueStart) {
		this.annualRevenueStart = annualRevenueStart;
	}

	public Integer getAnnualRevenueEnd() {
		return annualRevenueEnd;
	}

	public void setAnnualRevenueEnd(Integer annualRevenueEnd) {
		this.annualRevenueEnd = annualRevenueEnd;
	}

	public void setAnnualRevenue(String annualRevenue) {
		
		if(Constants.P_ANNUAL_REVENUE_EIGHT_WITHIN.equals(annualRevenue)){
			//8%以内
			annualRevenueStart = 0;
			annualRevenueEnd = 8;
		}else
		if(Constants.P_ANNUAL_REVENUE_EIGHT_TEN.equals(annualRevenue)){
			//8-10
			annualRevenueStart = 8;
			annualRevenueEnd = 10;
		}else
		if(Constants.P_ANNUAL_REVENUE_TEN_FIRTH.equals(annualRevenue)){
			//10-15
			annualRevenueStart = 10;
			annualRevenueEnd = 15;
		}else
		if(Constants.P_ANNUAL_REVENUE_FIRTH_MORE.equals(annualRevenue)){
			//15以上
			annualRevenueStart = 15;
		}else
		if(Constants.P_ANNUAL_REVENUE_UNLIMITED.equals(annualRevenue)){
			//不限 不添加信息
		}else{
			this.annualRevenue = annualRevenue;
		}
	}

	public String getRabateRatio() {
		return rabateRatio;
	}

	public void setRabateRatio(String rabateRatio) {
		if("01".equals(rabateRatio)){
			//1%以下(不包含1%)	
			rabateRatioStart = 0;
			rabateRatioEnd = 1;
		}else 
		if("02".equals(rabateRatio)){
			//1%-3%(不包含3%)
			rabateRatioStart = 1;
			rabateRatioEnd = 3;
		}else 
		if("03".equals(rabateRatio)){
			//3%及以上
			rabateRatioStart = 3;
		}else
		if("04".equals(rabateRatio)){
			//不限 不添加信息
		}
		this.rabateRatio = rabateRatio;
	}

	public Integer getRabateRatioStart() {
		return rabateRatioStart;
	}

	public void setRabateRatioStart(Integer rabateRatioStart) {
		this.rabateRatioStart = rabateRatioStart;
	}

	public Integer getRabateRatioEnd() {
		return rabateRatioEnd;
	}

	public void setRabateRatioEnd(Integer rabateRatioEnd) {
		this.rabateRatioEnd = rabateRatioEnd;
	}

	public String getRabateAnnualFlag() {
		if(annualRevenueStart != null || rabateRatioStart!= null){
			rabateAnnualFlag = "true";
		}
		return rabateAnnualFlag;
	}

	public void setRabateAnnualFlag(String rabateAnnualFlag) {
		this.rabateAnnualFlag = rabateAnnualFlag;
	}

	public Integer getMinimumAmountStart() {
		return minimumAmountStart;
	}

	public void setMinimumAmountStart(Integer minimumAmountStart) {
		this.minimumAmountStart = minimumAmountStart;
	}

	public Integer getMinimumAmountEnd() {
		return minimumAmountEnd;
	}

	public void setMinimumAmountEnd(Integer minimumAmountEnd) {
			this.minimumAmountEnd = minimumAmountEnd;
	}

	public String getSaleStatus() {
		return saleStatus;
	}

	public void setSaleStatus(String saleStatus) {
		this.saleStatus = saleStatus;
	}

    
}
